﻿using System;

using nAsterisk.AGI.Command;

namespace nAsterisk.AGI
{
    public interface IAsteriskAGI
    {
        AGIRequestInfo RequestInfo { get; }

        void Answer();
        void DatabaseDelete(string family, string key);
        void DatabaseDeleteTree(string family);
        void DatabaseDeleteTree(string family, string keeTree);
        string DatabaseGet(string family, string key);
        void DatabasePut(string family, string keyTree, string value);
        void EnableMusic(bool enabled);
        void EnableTDD(bool enabled);
        string Execute(string application, string options);
        ChannelStatus GetChannelStatus();
        ChannelStatus GetChannelStatus(string channelName);
        GetDataCommandResult GetData(string fileToStream);
        GetDataCommandResult GetData(string fileToStream, int timeout, int maxDigits);
        GetDataCommandResult GetData(string fileToStream, int timeout);
        string GetVariable(string variableName);
        void HangUp();
        void HangUp(string channelName);
        void Init();
        void Noop();
        void ProcessCommand(AGINoReturnCommandBase command);
        T ProcessCommand<T>(AGIReturnCommandBase<T> command);
        char? ReceiveChar();
        char? ReceiveChar(int timeout);
        string ReceiveText(int timeout);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, int? offsetSamples, bool beep);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, int? offsetSamples, bool beep, int? silence);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int? silence, int timeout);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, bool beep, int? silence);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, bool beep);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, int? offsetSamples, int? silence);
        char? RecordFile(string fileName, string format, Digits escapeDigits, int timeout, int? offsetSamples);
        Digits SayAlpha(string chars, Digits escapeDigits);
        Digits SayDate(DateTime date, Digits escapeDigits);
        Digits SayDateTime(DateTime time, Digits escapeDigits, string format, string timezone);
        Digits SayDateTime(DateTime time, Digits escapeDigits);
        Digits SayDigits(string number, Digits escapeDigits);
        Digits SayNumber(int number, Digits escapeDigits);
        Digits SayPhonetic(string message, Digits escapeDigits);
        Digits SayTime(DateTime time, Digits escapeDigits);
        void SendImage(string image);
        void SendText(string text);
        void SetAutoHangUp(int time);
        void SetCallerID(string number);
        void SetContext(string context);
        void SetExtension(string extension);
        void SetPriority(int priority);
        void SetVariable(string name, string value);
        StreamFileResult StreamFile(string filename, string escapedigits);
        StreamFileResult StreamFile(string filename, string escapedigits, int offset);
        StreamFileResult StreamFile(string filename, int offset);
        StreamFileResult StreamFile(string filename);
        void VerboseLog(string message, nAsterisk.AsteriskVerboseLevel level);
        Digits WaitForDigit(int timeout);
    }
}
